var express = require('express');
var router = express.Router();
const { addPostImgs, deleteImg, addSetImgs, addHeadImgs } = require("../api/movies")

/* GET home page. */

router.post('/addPostImgs', async function (req, res, next) {
    const data = await addPostImgs(req)
    res.send(data);
});
router.post('/addSetImgs', async function (req, res, next) {
    const data = await addSetImgs(req)
    res.send(data);
});
router.post('/addHeadImgs', async function (req, res, next) {
    const data = await addHeadImgs(req)
    res.send(data);
});
router.delete('/:_id/imgs/:url', async function (req, res, next) {
    // console.log(11);
    const { _id, url } = req.params;
    console.log(req.params);
    const data = await deleteImg(url);
    res.send(data)
});


module.exports = router;